﻿<Window x:Class="Resources.DynamicResource"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Resources" Height="300" Width="300"
    >
  <Window.Resources>
    <ImageBrush x:Key="TileBrush" x:Name="DynamicBrush" TileMode="Tile"
                ViewportUnits="Absolute" Viewport="0 0 32 32"
                ImageSource="happyface.jpg" Opacity="0.3"></ImageBrush>
  </Window.Resources>
  <StackPanel Margin="5">
    <Button Background="{DynamicResource TileBrush}" Padding="5"
            FontWeight="Bold" FontSize="14" Margin="5"
              >Uses a Dynamic Resource</Button>

    <Button Padding="5" Margin="5" Click="cmdChange_Click"
            FontWeight="Bold" FontSize="14">Change the Brush</Button>
    <Button Background="{StaticResource TileBrush}" Padding="5" Margin="5"
            FontWeight="Bold" FontSize="14"
              >Uses a Static Resource</Button>

  </StackPanel>
</Window>
